import type { RouteRecordRaw } from 'vue-router'

const loadComponent = (name: string) => {
  return () =>
    import(/* webpackChunkName: "reportManage" */ `@/views/reportManage/${name}/index.vue`)
}

export const routes: Array<RouteRecordRaw> = [
  /**
   * 组织碳
   */
  {
    path: '/tissueCarbon/analysis/distribution',
    component: loadComponent('tissueCarbon/analysis'),
    name: 'AnalysisDistribution',
    meta: {
      title: '碳排放分布分析',
      activeMenu: '/reportManage'
    }
  },
  {
    path: '/tissueCarbon/analysis/tendency',
    component: loadComponent('tissueCarbon/analysis'),
    name: 'AnalysisTendency',
    meta: {
      title: '碳排放趋势分析',
      activeMenu: '/reportManage'
    }
  },
  /**
   * 产品碳
   */

  // 碳排放对比分析
  {
    path: '/productCarbon/emissionComparison',
    component: loadComponent('productCarbon/emissionComparison'),
    name: 'FootprintEmissionComparison',
    meta: {
      title: '碳排放对比分析',
      bgColor: '#F3F7FB',
      activeMenu: '/reportManage'
    }
  },
  // 碳排放分布分析
  {
    path: '/productCarbon/emissionDistribution',
    component: loadComponent('productCarbon/emissionDistribution'),
    name: 'FootprintemissionDistribution',
    meta: {
      title: '碳排放热点分析',
      bgColor: '#F3F7FB',
      activeMenu: '/reportManage'
    }
  }
]

export default routes
